const sleep = async (delay: number): Promise<void> => new Promise<void>(resolve => setTimeout(resolve, delay));

const randomStr = (len: number, radix: number): string =>
  Math.floor(Math.random() * Math.pow(radix, len)).toString(radix).padStart(len, "0");

const uuid = (): string =>
  `${randomStr(8, 16)}-${randomStr(4, 16)}-${randomStr(4, 16)}-${randomStr(4, 16)}-${randomStr(6, 16)}${randomStr(6, 16)}`;

export {
  sleep, randomStr, uuid
};
